package com.example;

import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author:guoq
 * @date:2025/2/19
 * @descripion:
 */
@Configuration
@ConditionalOnClass(MyService.class)
public class MyAutoConfigure {
    //    @Bean
//    @ConditionalOnClass(ThreadPoolExecutor.class)//需要有该类才会被自动装配，该类为jdk自带，所以一定成立
//    public ThreadPoolExecutor MyThreadPool(){
//        return  new ThreadPoolExecutor(11,11,11,
//                TimeUnit.SECONDS,new ArrayBlockingQueue<>(100));
//    }
    @Bean
    public MyService myService() {
        return new MyService();
    }
}
